package org.ray.pattern.jobmanager.single;

import java.util.List;

public interface JobManager<T>
{
	public JobInfo<T> tryLockJob(JobInfo<T> jobInfo);
	public boolean unlockJob(T key, long timestamp);
	public boolean isJobCancellable(T key);
	public boolean isJobCancelled(T key);
	public void setJobFinished(T key);
	public void cancelJob(T key);
	public void updateJob(JobInfo<T> jobInfo);
	public List<JobInfo<T>> getRunningJobList();
	public JobInfo<T> getRunningJob(T key);

	public long getJobRunningTimeout();
	public void setJobRunningTimeout(long timeout);

	public long getJobCheckInterval();
	public void setJobCheckInterval(long interval);

	public long getWaitUnlockTick();
	public void setWaitUnlockTick(long tick);

	public long getWaitUnlockTickCount();
	public void setWaitUnlockTickCount(long tickCount);

	public int getWorkerCount();
	public void setWorkerCount(int workerCount);
}
